package com.wardrobe.soa.backend.practitioners;

import com.wardrobe.domain.common.BackEndFromBean;
import com.wardrobe.domain.practitioners.PractitionersBean;
import com.wardrobe.domain.practitioners.PractitionersFromBean;
import com.wardrobe.domain.practitioners.PractitionersShowBean;
import com.wardrobe.mapper.master.practitioners.PractitionersMasterMapper;
import com.wardrobe.mapper.slave.practitioners.PractitionersSlaveMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2018/11/30.
 */
@Service
public class BackPractitionersService {
    @Autowired
    private PractitionersSlaveMapper practitionersSlaveMapper;
    @Autowired
    private PractitionersMasterMapper practitionersMasterMapper;

    public List<PractitionersShowBean> practitionserList(PractitionersFromBean fromBean) {
        return practitionersSlaveMapper.selectPractionersList(fromBean);
    }

    public int savePractitoners(PractitionersBean bean) {
        return practitionersMasterMapper.insertPractitioners(bean);
    }

    public int modifyPractioners(BackEndFromBean fromBean) {
        return practitionersMasterMapper.updatePractitioners(fromBean);
    }

    public long countPractitioners(PractitionersFromBean fromBean) {
        return practitionersSlaveMapper.countPractionser(fromBean);
    }

    public int deletePractitioners(int id){
        return practitionersMasterMapper.deletePractitioners(id);
    }
}
